﻿<%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeBehind="relatoriorankingloja.aspx.cs" Inherits="CeA.Reports.Atendimento.Web.site.relatoriorankingloja" 
         Title="[Q-WEB]: Relatório de Ranking de Lojas" %>
<%@ Register src="../inc/WebControls/FiltroHierarquico.ascx" tagname="FiltroHierarquico" tagprefix="filtro" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
  <title>[Q-WEB]: Relatório de Ranking de Lojas</title>
  <script src="/js/jquery.jqprint.js" type="text/javascript"></script>
    <style type="text/css" media="screen">
        /*body *    {font-size:10pt; font-family:Arial}*/
        .sm-red   {font-size:0.8em; color:red}
        .w-huge   {width:130px!important}
        .w-larger {width:110px}
        .w-large  {width:65px}
        .w-small  {width:45px}
        .al-c     {text-align:center;}
        .pad-2    {padding:2px}
        .pad-3    {padding:3px}
        .b-1111   {border:1px solid silver}
        .b-1110   {border:1px solid silver; border-left: 0;}
        .b-0101w  {border:1px solid white; border-top: 0; border-bottom: 1px solid white}
        .b-0100w  {border-right: 1px solid white; border-bottom: 1px solid white}
        .xpto {border:1px solid black}
    </style>
    
    <script type="text/javascript" language="javascript">
        $(document).ready( function() {
            $("#cmdImprimir").click( function() {
                $("#<%=report.ClientID%>").jqprint( {debug:false} );
            });
        });
    </script>
</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="BodyContentPlaceholder" runat="server">
    <div class="filter-container" style="width:100%">
        <div class="filter-header">
            <span class="b" style="line-height:25px; color:#000">Filtro:</span>
        </div>
        <div class="filter-contents">
            <filtro:FiltroHierarquico ID="filtro" runat="server" />
        </div>
    </div>
    
    <div class="break">
        <asp:Button id="btnExportarExcel" Visible="false" Runat="server" Text="Exportar" CssClass="form-buttom"/>
        <span id="pnlImprimir" runat="server" visible="false">
            <input style="display:inline" id="cmdImprimir" type="button" class="form-buttom" value="Imprimir"/>
        </span>
    </div>
    
    <div class="break"></div>
    
    <div style="margin:auto;overflow:auto;min-height:420px" runat="server" id="report" visible="false">
        <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
            <tr style="line-height:30px">
                <th class="h1" colspan="18" style="background-color:#C5CFE9">RELATÓRIO DE RANKING DE LOJAS</th>
            </tr>
            <tr style="height:5px"><td colspan="18"></td></tr>
            <tr>
                <td colspan="5">&nbsp;</td>
                
                <td colspan="2" class="al-c pad-3 b-1111">
                  <div class="w-larger">Tempo Máximo de Espera</div>
                </td>
                <td colspan="2" class="al-c pad-3 b-1110">
                  <div class="w-larger">Tempo Médio de Espera</div>
                </td>
                <td colspan="2" class="al-c pad-3 b-1110">
                  <div class="w-larger">% de Clientes Atend em 15 min.</div>
                </td>
                <td colspan="2" class="al-c pad-3 b-1110">
                  <div class="w-larger">% de Desist&ecirc;ncia</div>
                </td>
                <td class="al-c pad-3 w-larger b-1110">
                  <div class="w-larger">Tempo Médio de Atendimento</div>
                </td>
                <td class="al-c b-1110">
                    <div class="w-large">TOTAL</div>
                </td>

                <td style="width: 10px">&nbsp;</td>
                <td class="w-large al-c pad-3 b-1111">
                  <div class="w-larger">Posição Semana Anterior</div>
                </td>
                <td class="w-large al-c pad-3 b-1110">
                  <div class="w-larger">Posição Penultima Semana</div>
                </td>
            </tr>
            <tr>
                <td class="sm-red">Ranking Loja</td>
                <td class="sm-red">Especialista</td>
                <td class="sm-red">Loja</td>
                <td class="sm-red">Região</td>
                <td colspan="">&nbsp;</td>
                
                <td class=""><div class="sm-red w-large al-c">Resultado</div></td>
                <td class=""><div class="sm-red w-small al-c">Posição</div></td>

                <td class=""><div class="sm-red w-large al-c">Resultado</div></td>
                <td class=""><div class="sm-red w-small al-c">Posição</div></td>

                <td class=""><div class="sm-red w-large al-c">Resultado</div></td>
                <td class=""><div class="sm-red w-small al-c">Posição</div></td>

                <td class=""><div class="sm-red w-large al-c">Resultado</div></td>
                <td class=""><div class="sm-red w-small al-c">Posição</div></td>

                <td class=""><div class="sm-red w-larger al-c">Resultado</div></td>
                <td class=""><div class="sm-red w-large al-c">&nbsp;</div></td>
                
                <td style="width: 10px">&nbsp;</td>
                
                <td><div class="w-large">&nbsp;</div></td>
                <td><div class="w-large">&nbsp;</div></td>
            </tr>

            <% foreach(CeA.Reports.Atendimento.DataAccess.DTO.RelatorioRankingDTO row in ReportDatasource) { %>
            <tr style="background-color: gainsboro">
                <td class="w-small b-0101w">
                    <div class="w-small"><%=row.RankingLoja%><sup>o</sup></div>
                </td>
                
                <td class="b-0100w">
                    <div class="w-large"><%=row.SiglaEspecialista%></div>
                </td>
                
                <td class="w-small b-0100w ">
                    <div class="w-small"><%=row.SiglaLoja%></div>
                </td>
                
                <td class="b-0100w" colspan="2">
                    <div class="w-large"><%=row.SiglaRegiao%></div>
                </td>
                
                <td class="al-c b-0100w">
                    <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMaximoEsperaResultado) %>
                </td>
                <td class="al-c b-0100w"><%= row.TempoMaximoEsperaPosicao %></td>

                <td class="al-c b-0100w">
                    <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMedioEsperaResultado) %>
                </td>
                
                <td class="al-c b-0100w"><%= row.TempoMedioEsperaPosicao %></td>

                <td class="al-c b-0100w"><%= row.PercentualAtendimento15minResultado %>%</td>
                <td class="al-c b-0100w"><%= row.PercentualAtendimento15minPosicao   %></td>

                <td class="al-c b-0100w"><%= row.PercentualDesistenciaResultado      %>%</td>
                <td class="al-c b-0100w"><%= row.PercentualDesistenciaPosicao        %></td>

                <td class="al-c b-0100w">
                    <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMedioAtendimentoResultado) %>
                </td>
                <td class="al-c b-0100w"><%= row.Total                               %></td>

                <td style="background-color: #fff">&nbsp;</td>
                <td class="al-c b-0100w"><%= row.PosicaoSemanaAnterior               %></td>
                <td class="al-c b-0100w"><%= row.PosicaoPenultimaSemana              %></td>
            </tr>
            <% } %>
            
            <tr><td colspan="18" style="height:10px"></td></tr>
            
            <%--<tr style="background-color: gainsboro;line-height:20px">
              <td colspan="2"><b>Flag Ship</b></td>
              <td colspan="16"><b>IGT</b></td>
            </tr>--%>
            
            <tr><td colspan="18" style="height:10px"></td></tr>
            
             <% foreach(CeA.Reports.Atendimento.DataAccess.DTO.RelatorioRankingDTO row in ReportRfsDatasource) { %>
            <tr style="background-color: gainsboro">
              <td colspan="2" style="background-color:#fff">&nbsp</td>
              
              <td class="b-0101w al-c"><%= row.RankingGrupo %> <sup>o</sup> </td>
              <td class="b-0100w" colspan="2"><%= row.NomeRfs %></td>
              
              <td class="b-0100w al-c">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMaximoEsperaResultado) %>
              </td>
              <td class="b-0100w al-c"><%= row.TempoMaximoEsperaPosicao %></td>
              
              <td class="b-0100w al-c">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMedioEsperaResultado) %>
              </td>
              <td class="b-0100w al-c"><%= row.TempoMedioEsperaPosicao %></td>
              
              <td class="b-0100w al-c"><%= row.PercentualAtendimento15minResultado%>%</td>
              <td class="b-0100w al-c"><%= row.PercentualAtendimento15minPosicao%></td>
              
              <td class="b-0100w al-c"><%=row.PercentualDesistenciaResultado %>%</td>
              <td class="b-0100w al-c"><%=row.PercentualDesistenciaPosicao %></td>

              <td class="b-0100w al-c">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(row.TempoMedioAtendimentoResultado) %>
              </td>
              <td class="b-0100w al-c"><%=row.Total%></td>
              
              <td colspan="4" class="b-0100w" style="background-color:#fff">&nbsp;</td>
            </tr>
            <% } %>
            
            <tr><td colspan="18" style="height:10px"></td></tr>
            <asp:Panel ID="pnConsolidadoBrasil" runat=server Visible="false">
            <tr  style="background-color: gainsboro;height:20px">
              <td colspan="5" class="b-0101w"><b>Consolidado Brasil</b></td>
              <td colspan="2" class="al-c b-0100w">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(ReportConsolidadoDatasource.TempoMaximoEsperaResultado)%>
              </td>
              <td colspan="2" class="al-c b-0100w">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(ReportConsolidadoDatasource.TempoMedioEsperaResultado)%>
              </td>
              <td colspan="2" class="al-c b-0100w"><%=ReportConsolidadoDatasource.PercentualAtendimento15minResultado%>%</td>
              <td colspan="2" class="al-c b-0100w"><%=ReportConsolidadoDatasource.PercentualDesistenciaResultado%>%</td>
              <td colspan="2" class="al-c b-0100w">
                  <%= CeA.Reports.Atendimento.DataAccess.Helpers.ConvertHelper.SecondToHour(ReportConsolidadoDatasource.TempoMedioAtendimentoResultado)%>
              </td>
              <td colspan="3" style="background:#fff">&nbsp;</td>
            </tr>
            </asp:Panel>
            
            <tr><td colspan="18" style="line-height:10px"></td></tr>
        </table>
        <%if (ReportDatasource.Count == 0) Response.Write("<br><b style='display:block;border:1px solid silver; padding:5px'>Registro não encontrado.</b>"); %> 
    </div>
    <br />
    <br />
    <br />      
</asp:Content>
